//app.js
const util = require("/utils/util.js");
App({
  onLaunch: function () {
    var that = this;
    /**login**/
    var openids = wx.getStorageSync("openid");
    var uid = wx.getStorageSync("uid");
    if(!openids || !uid){
      util.login(that.globalData.serverUrl + "api/v1/users/authories2");
    };
    wx.checkSession({
      success:function(){
        //session未过期,并且在本生命期一直有效
      },
      fail:function(){
        //登录过期
        util.login(that.globalData.serverUrl + "api/v1/users/authories2");
      }
    });
    util.getLocation();
  },
  globalData: {
    userInfo: null,
    serverUrl:'http://test.my51syx.com/',
    qiniuUrl:'http://seek.image.zhuxv.com',
    mapKey:'AB3BZ-KE5WG-7JOQ4-IN636-S4MSE-HVBYV'
  }
})